package cn.edu.nankai.bookstore.service.impl;

import cn.edu.nankai.bookstore.dao.ReceiverDao;
import cn.edu.nankai.bookstore.domain.po.Receiver;
import cn.edu.nankai.bookstore.service.ReceiverService;

import java.util.List;

public class ReceiverServiceImpl implements ReceiverService {
    private final ReceiverDao receiverDao = new com.test.nkbookshop.dao.homework.ReceiverDaoImpl();
    public boolean registerReceiver(Receiver receiver){
        return receiverDao.insert(receiver) != 0;
    }
    public List<Receiver> getAll(){
        return receiverDao.findAll();
    }
    public boolean modify(Receiver receiver){
        return receiverDao.update(receiver) != 0;
    }

    @Override
    public Receiver getById(Integer id) {
        return receiverDao.findById(id);
    }


    public boolean remove(Integer id) {
        return receiverDao.delete(id) != 0;
    }
}
